package org.will.ddd.domain;

import org.will.ddd.eventing.IDomainEvent;

/**
 * Created by EdifierWill on 2016/8/10.
 */
public interface IAggregateRoot {

    /// <summary>Represents the current version of the aggregate root.
    /// </summary>
    int Version();

    /// <summary>Get all the changes of the aggregate root.
    /// </summary>
    /// <returns></returns>
    Iterable<IDomainEvent> GetChanges();

    /// <summary>Accept changes with new version.
    /// </summary>
    /// <param name="newVersion"></param>
    void AcceptChanges(int newVersion);

    /// <summary>Replay the given event streams.
    /// </summary>
    /// <param name="eventStreams"></param>
    //void ReplayEvents(IEnumerable<DomainEventStream> eventStreams);
}
